<?php
/**
 * @name DashboardController.php
 * @copyright (c) 2011
 * @author Arsene Tochemey GANDOTE<arsene.gandote@yahoo.com>
 */
class DashboardController extends AppController{
	# Controller name
	var $name = 'Dashboard';
	# set the model to use
	var $uses = array('User','Group');
	# Set the layout to use
	var $layout = 'dashboard_layout';
	
	# Controllers Actions
	/**
	 * This function checks the authenticity of the user.
	 * @name beforeFilter
	 * @param void
	 * @return void
	 * @access public
	 * */
	function beforeFilter(){
	    parent::beforeFilter();
        parent::setUpGlobalConfig();
	}
	
	/**
	 * This is a kind of home page of the controller Dashboard.
	 * @name index
	 * @param void
	 * @var mixed $loggedUser array containing the logged user session data.
	 * @return void
	 * @access public
	 * */
	function index(){
        $userData= $this->Group->getGroupById($this->Auth->user('group_id'));
        $page_title = 'Dashboard';
        $this->set(compact('userData', 'page_title'));
	}

    function messages(){
        $userData= $this->Group->getGroupById($this->Auth->user('group_id'));
        $page_title = 'Messages';
        $this->set(compact('userData', 'page_title'));
    }

    function agenda(){
        $userData= $this->Group->getGroupById($this->Auth->user('group_id'));
        $page_title = 'Agenda';
        $this->set(compact('userData', 'page_title'));
    }
}
?>